FROM php-yjs:latest

ARG X_GID
ARG X_UID

USER root
RUN apk update \
    && apk add --no-cache supervisor \
    && mkdir -p /var/log/supervisor \
    && mkdir -p /etc/supervisor/conf.d \
    && rm -rf /var/cache/apk/* \
    && rm -rf /root/.cache \
    && rm -rf /tmp/*  

COPY ./supervisor.conf /etc/supervisor.conf
COPY ./php.conf /etc/supervisor/conf.d/
COPY ./crontab /etc/crontabs/clonetrooper
WORKDIR /data/www/yjs
ENTRYPOINT [ "supervisord", "-c", "/etc/supervisor.conf" ]
